<!DOCTYPE html>
<?php session_start();
ini_set("display_errors", 1);
include('../config.php');
require_once('../classes/class.jira.php');
include("../classes/connect.php");
require_once ('calendar/src/Google_Client.php');
require_once ('calendar/src/contrib/Google_CalendarService.php');

ini_set('display_errors', 'off');
//include('../header.php');
function getuser($username,$pass,$project,$host){
	$config->username= $username;
	$config->password= $pass;
	$config->port= "";
	$config->host= $host;
	$query->project = $project;

	$queryIssue = new Jira($config);
	$array=$queryIssue->queryUser($query);
	$response = json_decode($array->responseBody);
	return $response;
}

   function getDisplay($username,$pass,$host){
        $config->username= $username;
        $config->password= $pass;
        $config->port= "";
        $config->host= $host;

        $queryIssue = new Jira($config);
        $array=$queryIssue->getUser($username);
        $response = json_decode($array->responseBody);
        return $response;
        }
        
        $client = new Google_Client();
$client->setApplicationName("Google Calendar PHP Starter Application");


$client->setUseObjects(true); 
$cal = new Google_CalendarService($client);
if (isset($_GET['logout'])) {
  unset($_SESSION['token']);
}

if (isset($_GET['code'])) {
  $client->authenticate($_GET['code']);
  $_SESSION['token'] = $client->getAccessToken();
  header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
}

if (isset($_SESSION['token'])) {
  $client->setAccessToken($_SESSION['token']);
}

?>
   <link href="examples/content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="styles/kendo.dataviz.min.css" rel="stylesheet">
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
    <!--<link href="../css/header.css" rel="stylesheet">-->

    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.dataviz.min.js"></script>
    <script src="examples/content/shared/js/console.js"></script>
    <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
    
    
  
    <link href="examples/content/shared/styles/kendo.common.min.css" rel="stylesheet">
    <link href="examples/content/shared/styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="examples/content/shared/styles/kendo.default.min.css" rel="stylesheet">

    <!--<script src="js/jquery.min.js"></script>-->
    <script src="js/kendo.web.min.js"></script>
     <!--<script src="js/kendo.all.min.js"></script>-->
    <script src="examples/content/shared/js/console.js"></script>
    
    <!--<script src="js/jquery.min.js"></script>-->
    <link rel="stylesheet" href="../css/header.css" type="text/css" media="all">     

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JIRA COMMUNI</title>
<link href="../css/demo.css" rel="stylesheet" type="text/css" />
<!--<link rel="stylesheet" type="text/css" href="paginate/styles/style.css" />-->
</head>
<body class="sonata-bc" >
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid header-bar-container">
                <div class="header-bar-top">
                    <a class="brand">
                        <img src="images/logo_white.png" alt="JiraPortal">Recruitment Application      
                    </a>
                </div>
            </div>
<?$user=getuser($username,$pass,$project,$host);?>
            <div class="container-fluid">
                <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="nav-collapse">
                    <ul class="nav" id="menu" style="background-color: #1C2326">
                        <li class="active">
                        	<a class="dropdown-toggle" data-toggle="dropdown" href="reportdash.php"> Reports</a> 
                            
                        </li>
                        <li >
                            <a href="../home.php">Applications</a>
                        </li>
                         <?if (!($client->getAccessToken())) {
                                $authUrl = $client->createAuthUrl();
                        ?>
                         <li >
                            <a class="dropdown-toggle" data-toggle="dropdown" href='<?php echo $authUrl; ?>'  >Login Google Calendar</a>         
                        </li>
                  
                        <? } else if($client->getAccessToken()){ 
                             $_SESSION['token'] = $client->getAccessToken();
                             ?>
                         <li >
                            <a class="dropdown-toggle" data-toggle="dropdown" id="undoWeek"  >Calendar</a>         
                        </li>
                        <?}?>
                        <div class="navbar-text" style="top: 18px;">     
                                               
                             <div id="windowWeek" >
                                 <p style="font-size: 11px; color: green;">Note: If you are login first time or calendar is not properly displayed, please subscribe again and refresh your page</p>
                             
                              <div  class="span3" > 
                                     <div class="control-group" style="width: auto;">
                                         <label class="control-label" for="inputEmail" style="position: static; float: left;  font-size: 14px;  margin-top: 4px; top: 24px;width: 90px;">Calendars</label>
                                                                <div class="controls" style="float: left; width: 75%;">
                                                                   
                                                                    <select name="notify[]" id="chosen"  multiple="multiple" data-placeholder="Select..." >
                                                                       <?$i=0;
                                                                       foreach($user as $key){
                                                                       	
                                                                        ?>	
                                                                                <option  name="notify[]" value="src=<?php echo $key->name ?>%40eyepax.com&amp;color=%23<?php echo $calendarColor[$i];?>&amp"><?php echo $key->emailAddress ?></option>
                                                                        <?
																			$i=$i+1; }?>
                                                                        </select>
                                                                    
                                                                      </div>
                                                                 <button class="k-button" id="submitCalendar" style="margin-left: 10px;">Submit</button> 
                                                             
                                                            </div>
                                     
                                                    </div>
                                 
                               <div id="heading" style="position: absolute;top: 50px"><label>Carrers</label></div>    
                            
                              <!--  <iframe src="https://www.google.com/calendar/embed?mode=WEEK&amp;height=700&amp;wkst=2&amp;bgcolor=%23FFFFFF&amp;src=careers%40eyepax.com&amp;color=%232952A3&amp;src=achira.p%40eyepax.com&amp;color=%23125A12&amp;src=chamila.m%40eyepax.com&amp;color=%236B3304&amp;src=charith.r%40eyepax.com&amp;color=%23182C57&amp;src=%23contacts%40group.v.calendar.google.com&amp;color=%232F6309&amp;src=derick.k%40eyepax.com&amp;color=%23711616&amp;src=gawesha.b%40eyepax.com&amp;color=%23B1440E&amp;src=gayan.m%40eyepax.com&amp;color=%23875509&amp;src=lakshitha.w%40eyepax.com&amp;color=%235F6B02&amp;src=madushan.n%40eyepax.com&amp;color=%231B887A&amp;src=mahesha.h%40eyepax.com&amp;color=%23B1365F&amp;src=sanjaya.k%40eyepax.com&amp;color=%23853104&amp;src=tamara.s%40eyepax.com&amp;color=%2342104A&amp;src=tharaka.r%40eyepax.com&amp;color=%238D6F47&amp;src=tishan.m%40eyepax.com&amp;color=%23333333&amp;src=udeepa.j%40eyepax.com&amp;color=%23865A5A&amp;ctz=Asia%2FColombo" style=" border-width:0 " width="1000" height="700" frameborder="0" scrolling="no"></iframe> -->
                              <div id="iframeCalendar" style="position: relative; top: 40px;"><iframe  src="http://www.google.com/calendar/embed?showTitle=0&amp;showPrint=0&amp;mode=WEEK&amp;src=careers%40eyepax.com&color=%232952A3&amp;ctz=Asia/Colombo" style="border: 0" width="1000" height="600" frameborder="0" scrolling="no"></iframe></div>
 
                             </div>   
                                <script>
                                    $(document).ready(function() {
                                    	 $("#chosen").kendoMultiSelect().data("kendoMultiSelect");
                                        var windowWeek = $("#windowWeek"),
                                            undoWeek = $("#undoWeek").bind("click", function() {
                                                        windowWeek.data("kendoWindow").open();                                                      
                                                    });
                                        var onClose = function() {
                                            undoWeek.show();
                                        }

                                        if (!windowWeek.data("kendoWindow")) {
                                            windowWeek.kendoWindow({
                                                width: "1020px",
                                                 visible  : false,
                                                title: "Google Calendar",
                                                actions: [                                

                                                    "Close"
                                                ],
                                                close: onClose
                                            });
                                            undoWeek.show();
                                        }
                    
                                    $("#windowWeek").closest(".k-window").css({
                                     top: 100,
                                    left:"10%"
                                    });

                                    $('#submitCalendar').click(function (){

                                        var str=$('#chosen').val();
                                    	var res =str.join("amp;");

                                    	//alert($('#chosen').find('option:selected').text()); 
                                    	
                                    	var mail=$('#chosen').find('option:selected').text();
                                    	var user=mail.split('@eyepax.com');
                                    	var resUser =user.join("@eyepax.com, ");
                                    	$("#heading").html('<div id="heading"><label>Calendar for '+resUser+'</label></div>');
                                        $("#iframeCalendar").html('<div id="iframeCalendar"style="position: relative; top: 14px;"><iframe src="http://www.google.com/calendar/embed?showTitle=0&amp;showPrint=0&amp;mode=WEEK&amp;'+res+'amp;ctz=Asia/Colombo" style="border: 0" width="1000" height="600" frameborder="0" scrolling="no"</div>></iframe>');

									});
                                   
                                });
                            </script>
               
                    <p style="color: #FFFFFF;font-size: 15px;font-weight: 100;"> Welcome <?php

                            $display=  getDisplay($username, $pass, $host);
                           echo $display->displayName;
                           
                        ?> [ <a href="../logout.php">Logout</a> ]<p>
                </div>
            </div>
        </div>

        </div>
    </div>

<div class="homecontainer">
  
	<div class="taskdiv">	
            
	
		<div class="task">   
                   <h2 class="configHead">Summary </h2>   
                     <div style="float:left; width: 40%;min-width: 570px;  padding: 5px 1px;border: 1px solid #999999; border-radius: 7px;margin-right: 7px;"> 
                <div class="configuration k-widget k-header" style="position: relative; width:527px; max-width: 600px; z-index: 9999; float: left;max-height: 380px; margin-bottom: 14px;">
                        <span class="configHead">Weekly Summary - From  <?php echo  date('d-m-Y',strtotime('-1 weeks last monday'))." to ";
                                       echo  date('d-m-Y'); ?> </span>
                          <div >
                              <div id="chartweek" class="marg" style="position: relative;top: -28px;"></div>
                          </div>
                </div>
                <div class="configuration k-widget k-header" style="position: relative;  width:527px; max-width: 600px; z-index: 9999; float: left;max-height: 380px; margin-bottom: 14px;">
                        <span class="configHead">Year Summary - From  <?php echo  date('d-m-Y',strtotime('first day of January '.date('Y')))." to ";
                                       echo  date('d-m-Y'); ?> </span>
                          <div >
                            <div id="chartyear" class="marg" style="position: relative;top: -28px;" ></div>
                          </div>
                </div>
                
                 <div class="configuration k-widget k-header" style="position: relative;width:527px; max-width: 600px; z-index: 9999; float: left;max-height: 380px; margin-bottom: 14px;"><span class="configHead"> 
                         <label style="position: inherit;width: auto;">From&nbsp</label>&nbsp&nbsp<input id="fromDate" value="<?php echo  date('Y/m/d',strtotime('first day of previous month '));?>"  />&nbsp&nbsp
                                            
                             <label style="position: inherit;width: auto;">To&nbsp&nbsp</label>&nbsp&nbsp <input id="toDate" value="<?php echo  date('Y/m/d');?>"  />
                             &nbsp&nbsp<button class="k-button" id="submit">Submit</button> 
                        </span>
                          <div >                             
                            <div id="chartmanual" class="marg" style="position: relative;top: -28px;"></div>
                          </div>
                </div>
              
                
            </div>
            <div style="float: left; width: 58%; min-width: 850px;padding: 5px 1px;border: 1px solid #999999; border-radius: 7px;min-height: 600px;">
                 <div class="configuration k-widget k-header" style="position: relative;width:800px; max-width: 1000px; z-index: 9999; float: left;max-height: 420px;min-height: 100px; margin-bottom: 14px;">
                    <span class="configHead">Total Summary </span>
       
                    <table>
                        
                    <tr style="text-align: center;border-bottom: 1px solid #B8B8B8;">
                         <th style="min-width: 60px;"class="k-header">Period</th>
                            <th style="min-width: 60px;"class="k-header">Open Cv</th>
                            <th style="min-width: 60px;"class="k-header">Short Listed</th>
                            <th style="min-width: 60px;"class="k-header">Test Called</th>
                            <th style="min-width: 60px;"class="k-header">Tested</th>
                            <th style="min-width: 60px;"class="k-header">Interview Called</th>
                            <th style="min-width: 60px;"class="k-header">Interviewed</th>
                            <th style="min-width: 60px;"class="k-header">Final Interview Called</th>
                            <th style="min-width: 60px;"class="k-header">Final Interviewed</th>
                            <th style="min-width: 60px;"class="k-header">Selected</th>
                            <th style="min-width: 60px;"class="k-header">Joined</th>
                            <th style="min-width: 60px;"class="k-header">Offered</th>
                            <th style="min-width: 60px;"class="k-header">Rejected</th>
                    </tr>
              
                <tbody>
                    <tr style="text-align: center;border-bottom: 1px solid #B8B8B8;">
                        <td style="min-width: 60px;padding: 21px 0;"> Week </td>
                            <td id="weekopen" style="min-width: 60px;"></td>
                            <td id="weekshort" style="min-width: 60px;"></td>
                            <td id="weektestcall" style="min-width: 60px;"></td>
                            <td id="weektest" style="min-width: 60px;"></td>
                            <td id="weekintercall" style="min-width: 60px;"></td>
                            <td id="weekinter" style="min-width: 60px;"></td>
                            <td id="weekfinalcall" style="min-width: 60px;"></td>
                            <td id="weekfinal" style="min-width: 60px;"></td>
                            <td id="weekselec" style="min-width: 60px;"></td>
                            <td id="weekjoin" style="min-width: 60px;"></td>
                            <td id="weekoffer" style="min-width: 60px;"></td>
                            <td id="weekreject" style="min-width: 60px;"></td>
                    </tr>
                    <tr style="text-align: center;border-bottom: 1px solid #B8B8B8;">
                        <td style="min-width: 60px;padding: 21px 0;"> Year </td>
                            <td id="yearopen" style="min-width: 60px;"></td>
                            <td id="yearshort" style="min-width: 60px;"></td>
                            <td id="yeartestcall" style="min-width: 60px;"></td>
                            <td id="yeartest" style="min-width: 60px;"></td>
                            <td id="yearintercall" style="min-width: 60px;"></td>
                            <td id="yearinter" style="min-width: 60px;"></td>
                            <td id="yearfinalcall" style="min-width: 60px;"></td>
                            <td id="yearfinal" style="min-width: 60px;"></td>
                            <td id="yearselec" style="min-width: 60px;"></td>
                            <td id="yearjoin" style="min-width: 60px;"></td>
                            <td id="yearoffer" style="min-width: 60px;"></td>
                            <td id="yearreject" style="min-width: 60px;"></td>
                    </tr>
               
                </tbody>
                    </table>
                    
<!--                    <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
                        height: 430,
                        sortable: true
                    });
                });
            </script>-->
                    
                </div>
                <div class="configuration k-widget k-header" style="position: relative;width:800px; max-width: 1000px; z-index: 9999; float: left; margin-bottom: 14px;">
                 
                    <span class="configHead">Year Activity Summary - 
                    <?php  
                    	$sqlyear="SELECT Distinct YEAR(date(FROM_UNIXTIME(modifiedDate))) AS year from trn_activity";
                                $rs =mysql_query($sqlyear);?>
                                <select id="yearline" name="yearline"  onchange="yearchange()" >
                              <?php                                           
                               while ($row = mysql_fetch_array($rs))
                               {
                               		if ($row['year']==date('Y')) {
                               			echo "<option selected='selected' value='".$row['year']."'>".$row['year']."</option>";
                               		}
                               		else {
                               			echo "<option value='".$row['year']."'>".$row['year']."</option>";
                               		}
                               	
                               }
                    ?>
                    </select>
                    <?php //echo  date('Y'); ?> </span>
                    
                    <div id="chart" class="marg" style="position: relative;top: -8px;"></div>
                    
                       
                    <div style=" position:relative; left:15px;  z-index: 10;">
                        <table>
                            <tbody>
                            <tr>
                                <td style="width: 140px; padding: 6px 20px;">                                	
                                    <input id="chkopencv" type="checkbox" checked name="test" value="1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_opencv; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Open CV </p>                                    
                                    <input id="chkrejected" type="checkbox" checked name="test" value="value1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_rejected; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Rejected </p>
                                    <input id="chkshortlisted" type="checkbox" name="test" value="1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_shortlist; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Short Listed </p>
                                </td>   
                                <td style="width: 170px; padding: 6px 20px;">     
                                    <input id="chktested" type="checkbox" name="test" value="value1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_tested; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Tested </p>
                                    <input id="chktestcailled" type="checkbox" name="test" value="1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_testcall; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Test Called </p>
                                    <input id="chkintercall" type="checkbox" name="test" value="value1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_interviewcalled; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Interviewed Called </p>
                        
                                </td>
                                <td style="width: 180px; padding: 6px 35px;">
                                    <input id="chkinter" type="checkbox" checked name="test" value="1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_interview; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Interviewed </p>
                                    <input id="chkfinalintercall" type="checkbox" name="test" value="value1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_interviewcalled ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Final Interview Called </p>
                                    <input id="chkfinalinter" type="checkbox" name="test" value="1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_finalinterview ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Final Interviewed </p>
                                </td>
                                <td style="width: 125px;">   
                                    <input id="chkoffer" type="checkbox" name="test" value="value1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_offer; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Offer </p>
                                    <input id="chkselect" type="checkbox" name="test" value="1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_selected; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Selected </p>
                                    <input id="chkjoin" type="checkbox" name="test" checked value="value1"><div style="background: none repeat scroll 0% 0% <?php echo $colour_join; ?>; float: right; position: relative; left: 12px; height: 12px; width: 12px;"></div><p style=" font-size: 13px;line-height: 0.8em;"> Joined </p>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        
                    </div>
                </div>
            </div>
        </div>
	</div>
	
    
  
</div>
    
<div class="homecontainer">
  
	<div class="taskdiv">
      
         </div>
    <!--Line chart-->
      <script>      
       $(document).ready(function() {
                    $("#yearline").kendoDropDownList();
                    
                });

       function yearchange()
       {
    	   countChecked();
       }
          
          var countChecked = function() {
             $.ajax({
		  //url: "ajaxLinechartYear.php?year="+<?php echo  date('Y/m/d',strtotime('first day of January '.date('Y')))?>+"&todate="+<?php echo  date('Y/m/d')?>,
		  url: "ajaxLinechartYear.php?year="+$('#yearline').val()+"/1/1&todate="+<?php echo  date('Y/m/d')?>,
		  dataType:'json',
                  success: function(data)         
                    {
                            var opencv=data['Opencv'];
                            var rejected=data['rejected'];
                            var shortlist=data['shortlist'];
                            var tested=data['tested'];
                            var testcall=data['testcall'];
                            var interview=data['interview'];
                            var interviewcall=data['interviewcall'];
                            var finalinterview=data['finalinterview'];
                            var finalinterviewcall=data['finalinterviewcall'];
                            var offer=data['offer'];
                            var join=data['join'];
                            var selected=data['selected'];
                                                       //alert(opencv);
                            if (!$('#chkopencv').attr("checked")) {
                                opencv={};
                            }
                            if (!$('#chkrejected').attr("checked")) {
                                rejected={};
                            }
                            if (!$('#chkshortlisted').attr("checked")) {
                                shortlist={};
                            }
                            if (!$('#chktested').attr("checked")) {
                                tested={};
                            }
                            if (!$('#chktestcailled').attr("checked")) {
                                testcall={};
                            }
                            if (!$('#chkoffer').attr("checked")) {
                                offer={};
                            }
                            if (!$('#chkintercall').attr("checked")) {
                                interviewcall={};
                            }
                            if (!$('#chkinter').attr("checked")) {
                                interview={};
                            }
                            if (!$('#chkfinalintercall').attr("checked")) {
                                finalinterviewcall={};
                            }
                            if (!$('#chkfinalinter').attr("checked")) {
                                finalinterview={};
                            }
                            if (!$('#chkselect').attr("checked")) {
                                selected={};
                            }
                            if (!$('#chkjoin').attr("checked")) {
                                join={};
                            }
                            createChart(opencv,rejected,shortlist,tested,testcall,interview,interviewcall,finalinterview,finalinterviewcall,offer,join,selected);
                    }
		});
          };
          countChecked();

          $( "input[type=checkbox]" ).on( "click", countChecked );
           $(document).ready(function () {

                     $.ajax({
		  url: "ajaxLinechartYear.php?year="+<?php echo  date('Y/m/d',strtotime('first day of January '.date('Y')))?>+"&todate=2013/11/02",
		  dataType:'json',
                  success: function(data)         
                    {
                            var opencv=data['Opencv'];
                            var rejected=data['rejected'];
                            var shortlist=data['shortlist'];
                            var tested=data['tested'];
                            var testcall=data['testcall'];
                            var interview=data['interview'];
                            var interviewcall=data['interviewcall'];
                            var finalinterview=data['finalinterview'];
                            var finalinterviewcall=data['finalinterviewcall'];
                            var offer=data['offer'];
                            var join=data['join'];
                            var selected=data['selected'];
                                                       //alert(opencv);
                                                       if (!$('#chkopencv').attr("checked")) {
                                opencv={};
                            }
                            if (!$('#chkrejected').attr("checked")) {
                                rejected={};
                            }
                            if (!$('#chkshortlisted').attr("checked")) {
                                shortlist={};
                            }
                            if (!$('#chktested').attr("checked")) {
                                tested={};
                            }
                            if (!$('#chktestcailled').attr("checked")) {
                                testcall={};
                            }
                            if (!$('#chkoffer').attr("checked")) {
                                offer={};
                            }
                            if (!$('#chkintercall').attr("checked")) {
                                interviewcall={};
                            }
                            if (!$('#chkinter').attr("checked")) {
                                interview={};
                            }
                            if (!$('#chkfinalintercall').attr("checked")) {
                                finalinterviewcall={};
                            }
                            if (!$('#chkfinalinter').attr("checked")) {
                                finalinterview={};
                            }
                            if (!$('#chkselect').attr("checked")) {
                                selected={};
                            }
                            if (!$('#chkjoin').attr("checked")) {
                                join={};
                            }
                            createChart(opencv,rejected,shortlist,tested,testcall,interview,interviewcall,finalinterview,finalinterviewcall,offer,join,selected);
                    }
		});
                   
        });
          
        function createChart(yearopencv,rejected,shortlist,tested,testcall,interview,interviewcall,finalinterview,finalinterviewcall,offer,join,selected) {
           
            $("#chart").kendoChart({
//                title: {
//                    text: "Year Summary - From  <?php echo  date('d-m-Y',strtotime('first day of January '.date('Y')))." to ";
                                       echo  date('d-m-Y'); ?>//"
//                },
                legend: {
                    position: "bottom",
                    visible: false
                },
                chartArea: {
                    background: ""
                },
                seriesDefaults: {
                    type: "line"
                },
                series: [{                               
                    name: "<?php echo $action_OpenCV;?>",
                    data: yearopencv,
                    color: "<?php echo $colour_opencv;?>",
                    field:'opencv'
                },{
                    name: "<?php echo $action_Rejected;?>",
                    data: rejected,
                    color: "<?php echo $colour_rejected;?>",
                     field:'rejected'
                },{
                    name: "<?php echo $action_ShortList;?>",
                    data: shortlist,
                    color: "<?php echo $colour_shortlist;?>"
                },{
                    name: "<?php echo $action_Tested;?>",
                    data: tested,
                     color: "<?php echo $colour_tested;?>"
                },{
                    name: "<?php echo $action_TestCalled;?>",
                    data: testcall,
                    color: "<?php echo $colour_testcall;?>"
                },{
                    name: "<?php echo $action_Interviewed;?>",
                    data: interview,
                    color: "<?php echo $colour_interview;?>"
                },{
                    name: "<?php echo $action_InterviewCalled;?>",
                    data: interviewcall,
                    color: "<?php echo $colour_interviewcalled;?>"
                },{
                    name: "<?php echo $action_FinalInterviewed;?>",
                    data: finalinterview,
                    color: "<?php echo $colour_finalinterview;?>"
                },{
                    name: "<?php echo $action_InterviewCalled;?>",
                    data: finalinterviewcall,
                    color: "<?php echo $colour_finalinterviewcall;?>",
                },{
                    name: "<?php echo $action_Offered;?>",
                    data: offer,
                    color: "<?php echo $colour_offer;?>"
                },{
                    name: "<?php echo $action_Joined;?>",
                    data: join,
                    color: "<?php echo $colour_join;?>"
                },{
                    name: "<?php echo $action_Selected;?>",
                    data: selected,
                    color: "<?php echo $colour_selected;?>"
                }],
                valueAxis: {
                    labels: {
                        format: "{0}"
                    },
                    line: {
                        visible: false
                    },
                    majorUnit: <?php echo $majorUnit;?>,
                    max: <?php echo $max;?>,
                    min: <?php echo $min;?>,
                },
               
                categoryAxis: {
                    categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct','Nov','Dec'],
                    majorGridLines: {
                        visible: false
                    }
                },
                tooltip: {
                    visible: true,
                    format: "{0}",
                   template: " <?php echo  date('Y')?> - #=series.name # </br> ${category} - #= value #"
                },
                seriesClick: onWeekSeriesClick1
            });
        }

    //    $(document).ready(createChart);
      //  $(document).bind("kendo:skinChange", createChart);
      
       function onWeekSeriesClick1(e) {  
                //alert(e.category+e.series.name);
//                var fromdatestr="<?php echo date('Y-m-01', strtotime('e.category'));;?>";
//                var todatestr=$('#toDate').val();
//            alert(fromdatestr);
//               window.open("../home.php?from="+fromdatestr+"&to="+todatestr+"&cat=manual&type="+escape(e.series.name),"_self");
//                   
            }
    </script>

      
     
        <!--Week Summary-->
<script>

     $(document).ready(function() {
         
         var fromdatestr="<?php echo  date('Y/m/d',strtotime('-1 weeks last monday'));?> ";
      //   alert(fromdatestr);
         var todatestr="<?php echo  date('Y/m/d');?> "; 
            $.ajax({
		  url: 'ajaxChartWeek.php?fromdate='+fromdatestr+'&todate='+todatestr,
		  dataType:'json',
                  success: function(data)          //on recieve of reply
                    {
                            var n=data.split("-");
                            var from=n[0];
                            var to=n[1];
                            var total=n[2];
                            var opencv=Math.round((n[3]/n[2])*100);
                            var rejected=Math.round((n[4]/n[2])*100);
                            var shortlist=Math.round((n[5]/n[2])*100);
                            
                            var Interviewed=Math.round((n[6]/n[2])*100);
                            var Tested=Math.round((n[7]/n[2])*100);
                            var Selected=Math.round((n[8]/n[2])*100);
                            var Offered=Math.round((n[9]/n[2])*100);
                            var InterviewCalled=Math.round((n[10]/n[2])*100);
                            var TestCalled=Math.round((n[11]/n[2])*100);
                            var FinalInterviewCalled=Math.round((n[12]/n[2])*100);
                            var FinalInterviewed=Math.round((n[13]/n[2])*100);
                            var Joined=Math.round((n[14]/n[2])*100);
                            
                            document.getElementById("weekopen").innerHTML=n[3];
                            document.getElementById("weekshort").innerHTML=n[5];
                            document.getElementById("weektestcall").innerHTML=n[11];
                            document.getElementById("weektest").innerHTML=n[7];
                            document.getElementById("weekintercall").innerHTML=n[10];
                            document.getElementById("weekinter").innerHTML=n[6];
                            document.getElementById("weekfinalcall").innerHTML=n[12];
                            document.getElementById("weekfinal").innerHTML=n[13];
                            document.getElementById("weekselec").innerHTML=n[8];
                            document.getElementById("weekjoin").innerHTML=n[14];
                            document.getElementById("weekoffer").innerHTML=n[9];
                            document.getElementById("weekreject").innerHTML=n[4];
                          
                           createWeekChart(from,to,opencv,rejected,shortlist,Interviewed,Tested,Selected,Offered,InterviewCalled,TestCalled,FinalInterviewCalled,FinalInterviewed,Joined,total,
                                       n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14] );
                    }
		});
        });
  
	
//           function onWeekSeriesClick(e) {             
//                newwindow=window.open("reportdetail.php?cat=week&type="+e.category,'name','height=700,width=1340,scrollbars=yes');
//                        if (window.focus) {newwindow.focus()}
//                            return false;
//            }

 function onWeekSeriesClick(e) {             
               window.open("../home.php?cat=week&type="+escape(e.category),"_self");
                   
            }
	function createWeekChart(from,to,opencv,rejected,shortlist,Interviewed,Tested,Selected,Offered,InterviewCalled,TestCalled,FinalInterviewCalled,FinalInterviewed,Joined,total,
            toopencv,torejected,toshortlist,toInterviewed,toTested,toSelected,toOffered,toInterviewCalled,toTestCalled,toFinalInterviewCalled,toFinalInterviewed,toJoined) {
	  
        $("#chartweek").kendoChart({
            
                title: {
                    position: "top",
//                    text: "RCA Summary - From "+from+" To "+to,
                    font: "18px Arial,Helvetica,sans-serif",
                     
                },
                legend: {
                    position: "right",
                    visible: true,
                    padding: 0,
                    margin: 0,
                    labels: {
                         font: "16px"
                     }
                },
                chartArea: {
                    background: ""
                },
                seriesDefaults: {
                    labels: {
                        visible: true,
                        background: "transparent",
                        template: "#= value#%",
                        font: "10px",
                         position: "outsideEnd",
                    }
                },
                series: [{
                    type: "pie",
                    startAngle: 150,
                 padding: 50,
                
                    data: [{
                        category: "OpenCV - ("+toopencv+"/"+total+")",
                        //category2: "Open CV ",
                        value: opencv,
                        color: "<?php echo $colour_opencv;?>",
                        visibleInLegend : opencv > 0
                       
                    }
                    ,{
                       
                        category: "Short Listed - ("+toshortlist+"/"+total+")",
                        value:shortlist,
                        color: "<?php echo $colour_shortlist;?>",
                        visibleInLegend : shortlist > 0
                      
                    },{
                        category: "Test Called - ("+toTestCalled+"/"+total+")",
                        value: TestCalled,
                        color: "<?php echo $colour_testcall;?>",
                        visibleInLegend : TestCalled > 0
                    }
                    ,{
                        category: "Tested - ("+toTested+"/"+total+")",
                        value: Tested,
                        color: "<?php echo $colour_tested;?>",
                        visibleInLegend : Tested > 0
                    },{
                        category: "Interview Called - ("+toInterviewCalled+"/"+total+")",
                        value: InterviewCalled,
                        color: "<?php echo $colour_interviewcalled;?>",
                        visibleInLegend : InterviewCalled > 0
                    } ,{
                        category: "Interviewed - ("+toInterviewed+"/"+total+")",
                        value: Interviewed,
                        color: "<?php echo $colour_interview;?>",
                        visibleInLegend : Interviewed > 0
                    },{
                        category: "Final Interview Call - ("+toFinalInterviewCalled+"/"+total+")",
                        value: FinalInterviewCalled,
                        color: "<?php echo $colour_finalinterviewcall;?>",
                        visibleInLegend : FinalInterviewCalled > 0
                    },{
                        category: "Final Interviewed - ("+toFinalInterviewed+"/"+total+")",
                        value: FinalInterviewed,
                        color: "<?php echo $colour_finalinterview;?>",
                        visibleInLegend : FinalInterviewed > 0
                    },{
                        category: "Offered - ("+toOffered+"/"+total+")",
                        value: Offered,
                        color: "<?php echo $colour_offer;?>",
                        visibleInLegend : Offered > 0
                    }
                    
                   ,{
                        category: "Selected - ("+toSelected+"/"+total+")",
                        value: Selected,
                        color: "<?php echo $colour_selected;?>",
                        visibleInLegend : Selected > 0
                    }
                     
                     ,{
                        category: "Joined - ("+toJoined+"/"+total+")",
                        value: Joined,
                        color: "<?php echo$colour_join;?>",
                        visibleInLegend : Joined > 0
                    },{
                        category: "Rejected - ("+torejected+"/"+total+")",
                        value: rejected,
                        color: "<?php echo $colour_rejected;?>",
                        visibleInLegend : rejected > 0
                    }
                ]
                }],
                tooltip: {
                    visible: true,
                    format: "{0}%"
                },
                seriesClick: onWeekSeriesClick
            });
        }

        $(document).ready(createWeekChart);
        $(document).bind("kendo:skinChange", createWeekChart);
</script>
          
    <!--Year Summary-->
<script>

     $(document).ready(function() {
         
         var fromdatestr="<?php echo  date('Y');?> ";
        // alert(fromdatestr);
         var todatestr="<?php echo  date('Y/m/d');?> ";
            $.ajax({
		  url: 'ajaxChartWeek.php?year='+fromdatestr+'&todate='+todatestr,
		  dataType:'json',
                  success: function(data)          //on recieve of reply
                    {
                        
                            var n=data.split("-");
                            var from=n[0];
                            var to=n[1];
                            var total=n[2];
                            var opencv=Math.round((n[3]/n[2])*100);
                            var rejected=Math.round((n[4]/n[2])*100);
                            var shortlist=Math.round((n[5]/n[2])*100);
                            
                            var Interviewed=Math.round((n[6]/n[2])*100);
                            var Tested=Math.round((n[7]/n[2])*100);
                            var Selected=Math.round((n[8]/n[2])*100);
                            var Offered=Math.round((n[9]/n[2])*100);
                            var InterviewCalled=Math.round((n[10]/n[2])*100);
                            var TestCalled=Math.round((n[11]/n[2])*100);
                            var FinalInterviewCalled=Math.round((n[12]/n[2])*100);
                            var FinalInterviewed=Math.round((n[13]/n[2])*100);
                            var Joined=Math.round((n[14]/n[2])*100);
                            
                           // alert(total);
                           
                             document.getElementById("yearopen").innerHTML=n[3];
                            document.getElementById("yearshort").innerHTML=n[5];
                            document.getElementById("yeartestcall").innerHTML=n[11];
                            document.getElementById("yeartest").innerHTML=n[7];
                            document.getElementById("yearintercall").innerHTML=n[10];
                            document.getElementById("yearinter").innerHTML=n[6];
                            document.getElementById("yearfinalcall").innerHTML=n[12];
                            document.getElementById("yearfinal").innerHTML=n[13];
                            document.getElementById("yearselec").innerHTML=n[8];
                            document.getElementById("yearjoin").innerHTML=n[14];
                            document.getElementById("yearoffer").innerHTML=n[9];
                            document.getElementById("yearreject").innerHTML=n[4];
                 
                           createyearChart(from,to,opencv,rejected,shortlist,Interviewed,Tested,Selected,Offered,InterviewCalled,TestCalled,FinalInterviewCalled,FinalInterviewed,Joined,total,
                                       n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14] );
                    }
		});
        });
  
	
//           function onyearSeriesClick(e) {              
//                newwindow=window.open("reportdetail.php?cat=year&type="+e.category,'name','height=700,width=1340,scrollbars=yes');
//                        if (window.focus) {newwindow.focus()}
//                            return false;
//            }
   function onyearSeriesClick(e) {              
//              window.open("reportdetail.php?cat=year&type="+escape(e.category),"_self");
               window.open("../home.php?cat=year&type="+escape(e.category),"_self");
                      
            }
	function createyearChart(from,to,opencv,rejected,shortlist,Interviewed,Tested,Selected,Offered,InterviewCalled,TestCalled,FinalInterviewCalled,FinalInterviewed,Joined,total,
            toopencv,torejected,toshortlist,toInterviewed,toTested,toSelected,toOffered,toInterviewCalled,toTestCalled,toFinalInterviewCalled,toFinalInterviewed,toJoined) {
	
        $("#chartyear").kendoChart({
            
                title: {
                    position: "top",
//                    text: "RCA Summary - From "+from+" To "+to,
                    font: "18px Arial,Helvetica,sans-serif",
                     
                },
                legend: {
                    position: "right",
                    visible: true,
                    padding: 0,
                    margin: 0,
                    labels: {
                         font: "16px"
                     }
                },
                chartArea: {
                    background: ""
                },
                seriesDefaults: {
                    labels: {
                        visible: true,
                        background: "transparent",
                        template: "#= value#%",
                        font: "10px",
                         position: "outsideEnd",
                    }
                },
                series: [{
                    type: "pie",
                    startAngle: 150,
                 padding: 50,
                
                    data: [{
                        category: "OpenCV - ("+toopencv+"/"+total+")",
                        //category2: "Open CV ",
                        value: opencv,
                        color: "<?php echo $colour_opencv;?>",
                        visibleInLegend : opencv > 0
                       
                    }
                    ,{
                       
                        category: "Short Listed - ("+toshortlist+"/"+total+")",
                        value:shortlist,
                        color: "<?php echo $colour_shortlist;?>",
                        visibleInLegend : shortlist > 0
                      
                    },{
                        category: "Test Called - ("+toTestCalled+"/"+total+")",
                        value: TestCalled,
                        color: "<?php echo $colour_testcall;?>",
                        visibleInLegend : TestCalled > 0
                    }
                    ,{
                        category: "Tested - ("+toTested+"/"+total+")",
                        value: Tested,
                        color: "<?php echo $colour_tested;?>",
                        visibleInLegend : Tested > 0
                    },{
                        category: "Interview Called - ("+toInterviewCalled+"/"+total+")",
                        value: InterviewCalled,
                        color: "<?php echo $colour_interviewcalled;?>",
                        visibleInLegend : InterviewCalled > 0
                    } ,{
                        category: "Interviewed - ("+toInterviewed+"/"+total+")",
                        value: Interviewed,
                        color: "<?php echo $colour_interview;?>",
                        visibleInLegend : Interviewed > 0
                    },{
                        category: "Final Interview Call - ("+toFinalInterviewCalled+"/"+total+")",
                        value: FinalInterviewCalled,
                        color: "<?php echo $colour_finalinterviewcall;?>",
                        visibleInLegend : FinalInterviewCalled > 0
                    },{
                        category: "Final Interviewed - ("+toFinalInterviewed+"/"+total+")",
                        value: FinalInterviewed,
                        color: "<?php echo $colour_finalinterview;?>",
                        visibleInLegend : FinalInterviewed > 0
                    },{
                        category: "Offered - ("+toOffered+"/"+total+")",
                        value: Offered,
                        color: "<?php echo $colour_offer;?>",
                        visibleInLegend : Offered > 0
                    }
                    
                   ,{
                        category: "Selected - ("+toSelected+"/"+total+")",
                        value: Selected,
                        color: "<?php echo $colour_selected;?>",
                        visibleInLegend : Selected > 0
                    }
                     
                     ,{
                        category: "Joined - ("+toJoined+"/"+total+")",
                        value: Joined,
                        color: "<?php echo$colour_join;?>",
                        visibleInLegend : Joined > 0
                    },{
                        category: "Rejected - ("+torejected+"/"+total+")",
                        value: rejected,
                        color: "<?php echo $colour_rejected;?>",
                        visibleInLegend : rejected > 0
                    }
                ]
                }],
               tooltip: {
                    visible: true,
                    format: "{0}%"
                },
                seriesClick: onyearSeriesClick
            });
        }

        $(document).ready(createyearChart);
        $(document).bind("kendo:skinChange", createyearChart);
</script>
          
    <!--Period Summary-->
<script>
  $(document).ready(function() {
       var fromdatestr=$('#fromDate').val();
        // alert(fromdatestr);
            var todatestr=$('#toDate').val();
            
        var d1 = Date.parse(todatestr);
        var d2 = Date.parse(fromdatestr);
        if (d1 < d2) {
            alert ("Invalid Date period!\n From date should be lass than To date");
        }
        else
            {
                $.ajax({
                      url: 'ajaxChartWeek.php?fromdate='+fromdatestr+'&todate='+todatestr,
                      dataType:'json',
                      success: function(data)          //on recieve of reply
                        {

                                var n=data.split("-");
                                var from=n[0];
                                var to=n[1];
                                var total=n[2];
                                var opencv=Math.round((n[3]/n[2])*100);
                                var rejected=Math.round((n[4]/n[2])*100);
                                var shortlist=Math.round((n[5]/n[2])*100);

                                var Interviewed=Math.round((n[6]/n[2])*100);
                                var Tested=Math.round((n[7]/n[2])*100);
                                var Selected=Math.round((n[8]/n[2])*100);
                                var Offered=Math.round((n[9]/n[2])*100);
                                var InterviewCalled=Math.round((n[10]/n[2])*100);
                                var TestCalled=Math.round((n[11]/n[2])*100);
                                var FinalInterviewCalled=Math.round((n[12]/n[2])*100);
                                var FinalInterviewed=Math.round((n[13]/n[2])*100);
                                var Joined=Math.round((n[14]/n[2])*100);

                               // alert(total);

                               createmanualChart(from,to,opencv,rejected,shortlist,Interviewed,Tested,Selected,Offered,InterviewCalled,TestCalled,FinalInterviewCalled,FinalInterviewed,Joined,total,
                                           n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14] );
                        }
                    });
            }
  });

        $('#submit').click(function (){
        
          //  alert($('#fromDate').val());
             var fromdatestr=$('#fromDate').val();
        // alert(fromdatestr);
            var todatestr=$('#toDate').val();
            
        var d1 = Date.parse(todatestr);
        var d2 = Date.parse(fromdatestr);
        if (d1 < d2) {
            alert ("Invalid Date period!\n From date should be lass than To date");
        }
        else
            {
                $.ajax({
                      url: 'ajaxChartWeek.php?fromdate='+fromdatestr+'&todate='+todatestr,
                      dataType:'json',
                      success: function(data)          //on recieve of reply
                        {

                                var n=data.split("-");
                                var from=n[0];
                                var to=n[1];
                                var total=n[2];
                                var opencv=Math.round((n[3]/n[2])*100);
                                var rejected=Math.round((n[4]/n[2])*100);
                                var shortlist=Math.round((n[5]/n[2])*100);

                                var Interviewed=Math.round((n[6]/n[2])*100);
                                var Tested=Math.round((n[7]/n[2])*100);
                                var Selected=Math.round((n[8]/n[2])*100);
                                var Offered=Math.round((n[9]/n[2])*100);
                                var InterviewCalled=Math.round((n[10]/n[2])*100);
                                var TestCalled=Math.round((n[11]/n[2])*100);
                                var FinalInterviewCalled=Math.round((n[12]/n[2])*100);
                                var FinalInterviewed=Math.round((n[13]/n[2])*100);
                                var Joined=Math.round((n[14]/n[2])*100);

                               // alert(total);

                               createmanualChart(from,to,opencv,rejected,shortlist,Interviewed,Tested,Selected,Offered,InterviewCalled,TestCalled,FinalInterviewCalled,FinalInterviewed,Joined,total,
                                           n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14] );
                        }
                    });
            }
        });
  
	
//           function onmanualSeriesClick(e) { 
//             var fromdatestr=$('#fromDate').val();
//        // alert(fromdatestr);
//            var todatestr=$('#toDate').val();
//                newwindow=window.open("reportdetail.php?from="+fromdatestr+"&to="+todatestr+"&cat=manual&type="+e.category,'name','height=700,width=1340,scrollbars=yes');
//                        if (window.focus) {newwindow.focus()}
//                            return false;
//            }

 function onmanualSeriesClick(e) { 
             var fromdatestr=$('#fromDate').val();
        // alert(fromdatestr);
            var todatestr=$('#toDate').val();
             window.open("../home.php?from="+fromdatestr+"&to="+todatestr+"&cat=manual&type="+escape(e.category),"_self");
                      
            }
	function createmanualChart(from,to,opencv,rejected,shortlist,Interviewed,Tested,Selected,Offered,InterviewCalled,TestCalled,FinalInterviewCalled,FinalInterviewed,Joined,total,
            toopencv,torejected,toshortlist,toInterviewed,toTested,toSelected,toOffered,toInterviewCalled,toTestCalled,toFinalInterviewCalled,toFinalInterviewed,toJoined) {
	
        $("#chartmanual").kendoChart({
            
                title: {
                    position: "top",
//                    text: "RCA Summary - From "+from+" To "+to,
                    font: "18px Arial,Helvetica,sans-serif",
                     
                },
                legend: {
                    position: "right",
                    visible: true,
                    padding: 0,
                    margin: 0,
                    labels: {
                         font: "16px"
                     }
                },
                chartArea: {
                    background: ""
                },
                seriesDefaults: {
                    labels: {
                        visible: true,
                        background: "transparent",
                        template: "#= value#%",
                        font: "10px",
                         position: "outsideEnd",
                    }
                },
                   requestStart: function () {
                        kendo.ui.progress($("#loading"), true);
                    },
                    requestEnd: function () {
                        kendo.ui.progress($("#loading"), false);

                    },
                 series: [{
                    type: "pie",
                    startAngle: 150,
                 padding: 50,
                
                    data: [{
                        category: "OpenCV - ("+toopencv+"/"+total+")",
                        //category2: "Open CV ",
                        value: opencv,
                        color: "<?php echo $colour_opencv;?>",
                        visibleInLegend : opencv > 0
                       
                    }
                    ,{
                       
                        category: "Short Listed - ("+toshortlist+"/"+total+")",
                        value:shortlist,
                        color: "<?php echo $colour_shortlist;?>",
                        visibleInLegend : shortlist > 0
                      
                    },{
                        category: "Test Called - ("+toTestCalled+"/"+total+")",
                        value: TestCalled,
                        color: "<?php echo $colour_testcall;?>",
                        visibleInLegend : TestCalled > 0
                    }
                    ,{
                        category: "Tested - ("+toTested+"/"+total+")",
                        value: Tested,
                        color: "<?php echo $colour_tested;?>",
                        visibleInLegend : Tested > 0
                    },{
                        category: "Interview Called - ("+toInterviewCalled+"/"+total+")",
                        value: InterviewCalled,
                        color: "<?php echo $colour_interviewcalled;?>",
                        visibleInLegend : InterviewCalled > 0
                    } ,{
                        category: "Interviewed - ("+toInterviewed+"/"+total+")",
                        value: Interviewed,
                        color: "<?php echo $colour_interview;?>",
                        visibleInLegend : Interviewed > 0
                    },{
                        category: "Final Interview Call - ("+toFinalInterviewCalled+"/"+total+")",
                        value: FinalInterviewCalled,
                        color: "<?php echo $colour_finalinterviewcall;?>",
                        visibleInLegend : FinalInterviewCalled > 0
                    },{
                        category: "Final Interviewed - ("+toFinalInterviewed+"/"+total+")",
                        value: FinalInterviewed,
                        color: "<?php echo $colour_finalinterview;?>",
                        visibleInLegend : FinalInterviewed > 0
                    },{
                        category: "Offered - ("+toOffered+"/"+total+")",
                        value: Offered,
                        color: "<?php echo $colour_offer;?>",
                        visibleInLegend : Offered > 0
                    }
                    
                   ,{
                        category: "Selected - ("+toSelected+"/"+total+")",
                        value: Selected,
                        color: "<?php echo $colour_selected;?>",
                        visibleInLegend : Selected > 0
                    }
                     
                     ,{
                        category: "Joined - ("+toJoined+"/"+total+")",
                        value: Joined,
                        color: "<?php echo$colour_join;?>",
                        visibleInLegend : Joined > 0
                    },{
                        category: "Rejected - ("+torejected+"/"+total+")",
                        value: rejected,
                        color: "<?php echo $colour_rejected;?>",
                        visibleInLegend : rejected > 0
                    }
                ]
                }],
               tooltip: {
                    visible: true,
                    format: "{0}%"
                },
                seriesClick: onmanualSeriesClick
            });
        }

        $(document).ready(createyearChart);
        $(document).bind("kendo:skinChange", createyearChart);
</script>
 



 <script>
            $(document).ready(function() {
                // create DatePicker from input HTML element
                $("#fromDate").kendoDatePicker({
                    format: "yyyy/M/d"
                    });
                $("#toDate").kendoDatePicker({
              format: "yyyy/M/d"
              });

            });
        </script>
        <style scoped>
            
            
            #example h2 {
                font-weight: normal;
            }
            #email-settings {
                height: 135px;
                width: 395px;
                margin: 30px auto;
                padding: 110px 0 0 30px;
                background: url('../../content/web/datepicker/mailSettings.png') transparent no-repeat 0 0;
            }
        </style>

<style scoped>
                label{
                    /*width: 100px;*/
                      /*display:block*/
                      float: none;
                }
                .chart-wrapper {
                	margin: 27px 0 0 20px;
                	width: 700px;
                	height: 1400px;
                        float: left;
                        
                	background: url("../../content/shared/styles/chart-wrapper-small.png") transparent no-repeat 0 0;
                }
                
                .chart-wrapper .k-chart {
                    height: 800px;
                    padding: 0px 56%;
                    width:800px;
                    top: -43px;
                }
                .offline-button {
                    background: none repeat scroll 0 0 #8E8E8E;
                    border-radius: 16px 16px 16px 16px;
                    color: #FFFFFF;
                    display: inline-block;
                    height: 30px;
                    line-height: 30px;
                    margin: 10px 23px;
                    padding: 0 16px;
                    text-decoration: none;
                }
                .sonata-bc div.connection .control-group {
    padding: 0 20px 0 20px;
}
  .weather {
                    /*width: 160px;*/
                    padding: 15px 0 0 0;
                    /*float: right;*/
                    height: auto;
                }
                
                .marg{
                    /*margin-left: -28px;*/
                }
                
                .posi
                {
                    width:527px; 
                    max-width: 600px; 
                    z-index: 9999; 
                    float: left;
                }
                #undoWeek {
    cursor: pointer;
    padding: 1em;
    position: absolute;
    text-align: center;
    white-space: nowrap;
}

.km-touch-scrollbar
{
    position: absolute;
    visibility: hidden;
    z-index: 200000;
    height: .3em;
    width: .3em;
    background-color: #333;
    -moz-transform-origin: 0 0;
    -webkit-transform-origin: 0 0;
    -o-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transition: opacity 0.3s linear;
    -moz-transition: opacity 0.3s linear;
    -o-transition: opacity 0.3s linear;
    opacity: 0;
    -moz-border-radius: .4em;
    -webkit-border-radius: .4em;
    border-radius: .4em;
}

.km-vertical-scrollbar
{
    height: 100%;
    right: 1px;
    top: 0;
}

.km-horizontal-scrollbar
{
    width: 100%;
    left: 0;
    bottom: 1px;
}

.km-scroll-container
{
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}
.line{
     font-size: 12px;
    line-height: 0.8em;
}

            </style>
        </div>

    
    <!--
   -->


</body>
</html>